import {
	http
} from '@/service/index.js'
import store from '@/store/index.js'
import configs from '@/config/index.js'

// 查询用户所有地址
export const addressList = async (data, config = {}) => {
	return await http.get(`/personal/center/user/address/list`, data, config)
}

// 查询用户默认的收货地址
export const getDefault = async (data, config = {}) => {
	return await http.get(`/personal/center/user/address/getDefault`, data, config)
}

// 把用户地址设为默认
export const setDefault = async (data) => {
	return await http.post(`/personal/center/user/address/setDefault`, data)
}

export const addressdel = async (data, config = {}) => {
	return await http.post(`/personal/center/user/address/del`, data)
}

export const addressupdate = async (data, config = {}) => {
	return await http.post(`/personal/center/user/address/update`, data, config)
}

export const addrescreate = async (data, config = {}) => {
	return await http.post(`/personal/center/user/address/create`, data, config)
}
